﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CsharpTpl.common;

namespace CsharpTpl.window
{
    public partial class FrmPrintClient : Form
    {
        private string xmlpath;
        public FrmPrintClient()
        {
            InitializeComponent();
        }
        public void Init(long _bbid, Dictionary<string, string> _parms)
        {
            xmlpath = XMLPrint.GetXMLFilePath(_bbid, _parms);
        }

        private void axPrintClient1_OnInit(object sender, EventArgs e)
        {
            axPrintClient1.ShowInForm = true;
            axPrintClient1.ShowToolBar = true;
            //axPrintClient1.ShowCaption = true;
            axPrintClient1.CanClose = true;
            axPrintClient1.CanEdit = true;
            axPrintClient1.CanDesign = true;
            //axPrintClient1.LoadGridFromFile(Application.StartupPath + @"\report\dataxxml.xml");
            axPrintClient1.LoadGridFromFile(xmlpath);
            //axPrintClient1.LoadFromFile(Application.StartupPath+@"\report\dataxml.xml", Application.StartupPath+@"\report\jqbb_rbb.rls");
            axPrintClient1.ShowPreview();
        }

        private void axPrintClient1_OnClose(object sender, EventArgs e)
        {
            //axPrintClient1.Dispose();
            //this.Dispose();
            //this.Close();
            this.Hide();
        }


    }
}
